<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<!-- remove old header -->


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cogen API Reference Documentation
        - Class: SocketOperation</title><meta name="MSSmartTagsPreventParsing" content="true" /><meta http-equiv="imagetoolbar" content="no" /><link href="css/default.css" rel="stylesheet" type="text/css" /><link href="css/pygments.css" rel="stylesheet" type="text/css" />
    <!-- <link rel="shortcut icon" href="/images/favicon.ico" type="image/vnd.microsoft.icon"/> -->
    <link rel="stylesheet" href="css/apydia.css" type="text/css" />
    <script src="js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="js/apydia.js" type="text/javascript"></script>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
    <div id="page">
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="cogen.html">cogen</a>
                    </li><li>
                        <a href="cogen.common.html">cogen.common</a>
                    </li><li>
                        <a href="cogen.core.html">cogen.core</a>
                    </li><li>
                        <a href="cogen.core.coroutines.html">cogen.core.coroutines</a>
                    </li><li>
                        <a href="cogen.core.events.html">cogen.core.events</a>
                    </li><li>
                        <a href="cogen.core.proactors.html">cogen.core.proactors</a>
                    </li><li>
                        <a href="cogen.core.proactors.base.html">cogen.core.proactors.base</a>
                    </li><li>
                        <a href="cogen.core.proactors.epoll_impl.html">cogen.core.proactors.epoll_impl</a>
                    </li><li>
                        <a href="cogen.core.proactors.poll_impl.html">cogen.core.proactors.poll_impl</a>
                    </li><li>
                        <a href="cogen.core.proactors.select_impl.html">cogen.core.proactors.select_impl</a>
                    </li><li>
                        <a href="cogen.core.pubsub.html">cogen.core.pubsub</a>
                    </li><li>
                        <a href="cogen.core.queue.html">cogen.core.queue</a>
                    </li><li>
                        <a href="cogen.core.schedulers.html">cogen.core.schedulers</a>
                    </li><li class="active">
                        <a href="cogen.core.sockets.html">cogen.core.sockets</a>
                    </li><li>
                        <a href="cogen.core.util.html">cogen.core.util</a>
                    </li><li>
                        <a href="cogen.web.html">cogen.web</a>
                    </li><li>
                        <a href="cogen.web.async.html">cogen.web.async</a>
                    </li><li>
                        <a href="cogen.web.wsgi.html">cogen.web.wsgi</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>cogen.core.sockets</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.Accept.html">Accept</a>
                    </li><li>
                        <a href="cogen.core.sockets.Connect.html">Connect</a>
                    </li><li>
                        <a href="cogen.core.sockets.SendFile.html">SendFile</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html">Socket</a>
                    </li><li class="active">
                        <a href="cogen.core.sockets.SocketOperation.html">SocketOperation</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Constructor</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.SocketOperation.html#constructor">__init__</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.SocketOperation.html#method-cleanup">cleanup</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#method-fileno">fileno</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#method-finalize">finalize</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#method-process">process</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#method-set_timeout">set_timeout</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Attributes</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-coro">coro</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-delta">delta</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-last_checkpoint">last_checkpoint</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-last_update">last_update</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-prio">prio</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-sock">sock</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-state">state</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-timeout">timeout</a>
                    </li><li>
                        <a href="cogen.core.sockets.SocketOperation.html#attribute-weak_timeout">weak_timeout</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: cogen.core.sockets.SocketOperation</h1>
    <div class="docstring rst"><p>This is a generic class for a operation that involves some socket call.</p>
<p>A socket operation should subclass WriteOperation or ReadOperation, define a
<cite>run</cite> method and call the __init__ method of the superclass.</p>
</div>
    <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk/cogen/core/sockets.py#189">View source</a>
    </li>
</ul>
    <div>
        <h2>Constructor</h2>
        <h3 id="constructor">
            __init__
            <span class="args">(self, sock, **kws)</span>
        </h3>
        <div class="docstring rst"><p>All the socket operations have these generic properties that the
poller and scheduler interprets:</p>
<blockquote>
<ul class="simple">
<li>timeout - the ammout of time in seconds or timedelta, or the datetime
value till the poller should wait for this operation.</li>
<li>weak_timeout - if this is True the timeout handling code will take
into account the time of last activity (that would be the time of last
<cite>try_run</cite> call)</li>
<li>prio - a flag for the scheduler</li>
</ul>
</blockquote>
</div>
        <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
    </div>
    <div>
        <h2>Methods</h2>
            <h3 id="method-cleanup">
                cleanup
                <span class="args">(self, sched, coro)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="method-fileno">
                fileno
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="method-finalize">
                finalize
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Called just before the Coroutine wrapper passes the operation back
in the generator. Return value is the value actualy sent in the
generator. Subclasses might overwrite this method and call it from
the superclass.</p>
</div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="method-process">
                process
                <span class="args">(self, sched, coro)</span>
            </h3>
            <div class="docstring rst"><p>Add the timeout in the scheduler, check for defaults.</p>
</div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="method-set_timeout">
                set_timeout
                <span class="args">(self, val)</span>
            </h3>
            <div class="docstring rst"></div>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
    </div>
    <div>
        <h2>Attributes</h2>
            <h3 id="attribute-coro">coro</h3>
            <div class="docstring rst"></div>
            <h4>Value of coro</h4>
            <pre class="code"><code>&lt;member 'coro' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-delta">delta</h3>
            <div class="docstring rst"></div>
            <h4>Value of delta</h4>
            <pre class="code"><code>&lt;member 'delta' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-last_checkpoint">last_checkpoint</h3>
            <div class="docstring rst"></div>
            <h4>Value of last_checkpoint</h4>
            <pre class="code"><code>&lt;member 'last_checkpoint' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-last_update">last_update</h3>
            <div class="docstring rst"></div>
            <h4>Value of last_update</h4>
            <pre class="code"><code>&lt;member 'last_update' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-prio">prio</h3>
            <div class="docstring rst"></div>
            <h4>Value of prio</h4>
            <pre class="code"><code>&lt;member 'prio' of 'Operation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-sock">sock</h3>
            <div class="docstring rst"></div>
            <h4>Value of sock</h4>
            <pre class="code"><code>&lt;member 'sock' of 'SocketOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-state">state</h3>
            <div class="docstring rst"></div>
            <h4>Value of state</h4>
            <pre class="code"><code>&lt;member 'state' of 'Operation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-timeout">timeout</h3>
            <div class="docstring rst"></div>
            <h4>Value of timeout</h4>
            <pre class="code"><code>&lt;member 'timeout' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
            <h3 id="attribute-weak_timeout">weak_timeout</h3>
            <div class="docstring rst"></div>
            <h4>Value of weak_timeout</h4>
            <pre class="code"><code>&lt;member 'weak_timeout' of 'TimedOperation' objects&gt;</code></pre>
            <ul class="link-bar">
    <li class="link-to-sourcecode">
        <a href="http://code.google.com/p/cogen/source/browse/trunk#0">View source</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.3</a>
        </div>
    </div>
</body>
</html>